package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.vo.DishItemVO;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    @Select("SELECT * FROM dish WHERE category_id = #{id}")
    List<Dish> selectByCategoryId(Long id);

    List<Dish> select(Dish dish);

    Page<DishVO> page(DishPageQueryDTO dto);

    void update(Dish dish);

    void delete(String[] idArr);

    @Select("SELECT * FROM dish WHERE id = #{id}")
    Dish selectById(long id);

    Long insert(Dish dish);

    @Select("SELECT COUNT(*) FROM dish WHERE status = #{status}")
    Integer countByStatus(Integer status);

    List<Dish> getDishAndCategoryNameByCategoryId(Long categoryId);


}
